package com.dcits.electronic_account.utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: CZJ
 * @Date： 2022/6/26
 */

@RestControllerAdvice
public class SysRuntimeExceptionHandler {
    @ExceptionHandler(TokenRuntimeException.class)
    public ResultT tokenRuntimeException(TokenRuntimeException e) {
        e.printStackTrace();
        return ResultT.error(e.getCode(), e.getMsg());
    }

    @ExceptionHandler(Exception.class)
    public ResultT handlerException(Exception e){
        e.printStackTrace();
        return ResultT.error();
    }
}
